//
//  MRServer.h
//  McRemoteServer
//
//  Created by Magic on 12/8/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@class MRServer;

@protocol MRServerDelegate <NSObject>

- (void)didReadData:(NSData *)data withTag:(long)tag;

@optional
- (void)serverDidAcceptNewConnection;


@end

@interface MRServer : NSObject <NSNetServiceDelegate>

@property (nonatomic,assign) id<MRServerDelegate> delegate;

+ (MRServer *)sharedServer;
- (void)start;
- (void)enableBonjourWithServiceType:(NSString *)type;
- (void)readDataToLength:(NSUInteger)length tag:(long)tag;
//- (void)readDataToData:(NSData *)data tag:(long)tag;
//- (void)readDataToString:(void *)string length:(NSUInteger)length tag:(long)tag;
- (void)writeData:(NSData *)data tag:(long)tag;

@end
